package com.produce.user.mapper;


import com.produce.user.dto.OrganizationalStructureDto;
import com.produce.user.entity.OrganizationalStructure;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 类描述：组织架构数据转换工具
 *
 * @author linzf
 */
@Mapper(componentModel = "spring")
public interface OrganizationalStructureMapper {

    /**
     * 功能描述：实现将组织架构的实体进行相应的转换
     * @param organizationalStructure
     * @return
     */
    @Mapping(target = "title", source = "orgName")
    @Mapping(source = "orgId", target = "orgId")
    OrganizationalStructureDto organizationalStructureToOrganizationalStructureDto(OrganizationalStructure organizationalStructure);


    /**
     * 功能描述：实现组织架构集合的实体转换
     * @param organizationalStructureList
     * @return
     */
    List<OrganizationalStructureDto> organizationalsStructureToOrganizationalStructureDto(List<OrganizationalStructure> organizationalStructureList);

}
